const pool = require('../config/query.config')

module.exports = sql => {
    return new Promise((resolve, reject) => {
        pool.getConnection(function (err, conn) {
            if(err) reject(err);
            conn.query(sql, function (err, rows, fields) {
                conn.release();
                if(err) reject(err);
                resolve(rows)
            })
        })
    })
}


